package error_code

type Code_type_int int32

const (
	SUCCESS_STATUS             = 0
	REDIS_ERR                  = 0x70000500
	SYS_ERR                    = 0x70000501
	DB_ERR                     = 0x70000601
	PASSWORD_ERR               = 0x70000703
	LOGIN_OUT_ERR              = 0x70000709
	PARAM_ERR                  = 0x70000710
	PHONE_EMAIL_NOT_EXISTS_ERR = 0x70000714
	NICKNAME_EMPTY             = 0x70000715
	PASSWORD_EMPTY             = 0x70000716
	PASSWORD_SAME              = 0x70000719
	PASSWORD_FORMAT_ERR        = 0x70000718
	NOT_FIND_ERR               = 0x70000404
	NOT_ALLOW_CORS             = 0x70000802
	NOT_ALLOW_IP               = 0x70000803
	USER_NUM_ERR               = 0x70000717
	PARTIALPHONE_SAME          = 0x70000804
)

var INFO = GetInfo()

func GetInfo() map[Code_type_int]string {
	info := make(map[Code_type_int]string)

	info[SUCCESS_STATUS] = "成功"
	info[REDIS_ERR] = "失败"
	info[SYS_ERR] = "系统错误"
	info[DB_ERR] = "DB 错误"
	info[PASSWORD_ERR] = "密码或用户名错误"
	info[LOGIN_OUT_ERR] = "退出登陆"
	info[PARAM_ERR] = "参数错误"
	info[PHONE_EMAIL_NOT_EXISTS_ERR] = "用户名错误"
	info[NICKNAME_EMPTY] = "昵称为空"
	info[PASSWORD_EMPTY] = "密码为空"
	info[PASSWORD_SAME] = "密码不能相同"
	info[PASSWORD_FORMAT_ERR] = "密码必须包含数字和字母, 长度6-30位"
	info[NOT_FIND_ERR] = "未找到"
	info[NOT_ALLOW_CORS] = "安全限制"
	info[NOT_ALLOW_IP] = "IP 限制"
	info[USER_NUM_ERR] = "查询用户数量超过限制"
	info[PARTIALPHONE_SAME] = "分机号重复"

	return info
}
